// https : // iai.sh.cn/problem/448
#include <bits/stdc++.h>
using namespace std;
int a[100];
int main() {
  int n = 6;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  int sum = a[n] + a[n - 1] + a[n - 2];
  cout << sum << endl;
  return 0;
}